import { cities } from './address'


const cascader = []; //级联数据
// 省/市

for (const province in cities) {
    const provinceItem = {
        value: province,
        label: province,
        children: []
    }

    // 市/区
    for (const area in cities[province]) {
        // 遍历区
        const children = cities[province][area].map(item => ({
            value: item,
            label: item
        }))

        const areaItem = {
            value: area,
            label: area,
            children
        }

        provinceItem.children.push(areaItem)
    }

    cascader.push(provinceItem)
}

export default cascader